<template>
  <el-card shadow="never">
    <el-button @click="handleBack">返回</el-button>
    <e-table
      ref="eTable"
      :tableData="tableData"
      :columns="columns"
      :loading="loading"
      :pageObj="null"
      :border="null"
    />
  </el-card>
</template>

<script>
import { getServiceWindowDetails } from '@/api/monitor'
import { getMonitorTime } from '@/utils/util'

export default {
  data() {
    return {
      tableData: [],
      columns: [
        {
          label: '科室',
          prop: 'orgName'
        },
        {
          label: '总数',
          prop: 'total'
        },
        {
          label: '非常满意',
          prop: 'verySatisfy'
        },
        {
          label: '满意',
          prop: 'satisfy'
        },
        {
          label: '一般',
          prop: 'basicSatisfy'
        },
        {
          label: '不满意',
          prop: 'dissatisfy'
        },
        {
          label: '满意率',
          prop: 'satisfyRate'
        }
      ],
      loading: false
    }
  },
  created() {
    let param = getMonitorTime()
    console.log('route', this.$route)
    const row = JSON.parse(this.$route.query.row)
    getServiceWindowDetails({ userId: row.userId, ...param }).then(res => {
      this.tableData = res.data
    })
  },
  methods: {
    handleBack() {
      this.$router.push({ name: 'monitorIndex' })
    }
  }
}
</script>
